//教师列表
import request from "./request";

//学生列表
export class StudentListApi {
    getMajorList() {
        return request({url: '/api/v1/org/getMajor', method: 'get'})
    }

    getStudentList({page, search, major}) {
        let data = {page, search, major}
        return request({url: '/api/v1/org/getStudentList', method: 'post', data})
    }
}

//学生详情
export class StudentInfoApi {
    getStudentInfo({sid, rid}) {
        let data = {sid, rid} //sid:学生id   rid:班级id
        return request({url: '/api/v1/org/getStudentDetail', method: 'post', data, loading: false})
    }

    updateStudentStatus({status, student_id}) {
        let data = {status, student_id} //是否启用,【1启用2停用】
        return request({url: '/api/v1/org/studentStatus', method: 'post', data, loading: false})
    }

    //获取学员信息-学生详情
    getStudentStudyInfo({sid, rid}) {
        let data = {sid, rid} //sid:学生id  rid:班级id
        return request({url: '/api/v1/org/getPersonInfo', method: 'post', data, loading: false})
    }

    //获取消课记录
    getCostLessonList({sid, page}) {
        let data = {sid, page} //sid:学生id  rid:班级id
        return request({url: '/api/v1/org/getDispelClass', method: 'post', data})
    }
}

//学生作业详情
export class StudentHomeWorkApi {
    getHomeWorkList({sid, type, page}) {
        let data = {sid, type, page} //type:状态值，默认为10【20-已完成，10-未完成】
        return request({url: '/api/v1/org/getHomeWorkList', method: 'post', data})
    }

    //提交的作业详情
    getHomeWorkDetailPush(id) {
        let data = {id} //作业id
        return request({url: '/api/v1/org/showHomeWorkDetail', method: 'get', data})
    }

    //布置的作业详情
    getHomeWorkDetailLayout(id) {
        let data = {id} //作业id
        return request({url: '/api/v1/org/getHomeWorkDetail', method: 'get', data})
    }
}

//学籍-学生教学目标
export class StudentTeachGoalApi {
    getTeachGoalList({sid, page}) {
        let data = {sid, page}//sid:学生id
        return request({url: '/api/v1/org/getObjectiveList', method: 'post', data})
    }

    getTeachGoalDetail(obj_id) {
        let data = {obj_id}
        return request({url: '/api/v1/org/getObjectiveDetail', method: 'get', data})
    }

    getCommentList({sid, page}) {
        let data = {sid, page}//sid:学生id
        return request({url: '/api/v1/org/getCommentList', method: 'post', data})
    }

    getCommentDetail(comment_id) {
        let data = {comment_id}//comment_id:评价id
        return request({url: '/api/v1/org/showCommentDetail', method: 'get', data})
    }
}

//学籍-积分详情
export class CscoreDetailApi {
    //获取学员信息-学生详情
    getStudentStudyInfo({sid, rid}) {
        let data = {sid, rid} //sid:学生id  rid:班级id
        return request({url: '/api/v1/org/getPersonInfo', method: 'post', data, loading: false})
    }

    //获取积分记录的接口
    getCscoreRecordList({sid, page}) {
        let data = {sid, page} //sid:学生id
        return request({url: '/api/v1/org/getPointsLog', method: 'post', data})
    }

    //获取商品兑换记录的接口
    getCscoreChargeList({sid, page}) {
        let data = {sid, page} //sid:学生id
        return request({url: '/api/v1/org/exchangerecord', method: 'post', data})
    }
}

//学籍-班级列表-学生列表
export class ClassStudentApi {
    getMajorList() {
        return request({url: '/api/v1/org/getMajor', method: 'get'})
    }

    getClassList({page, search, major}) {
        let data = {page, search, major}
        return request({url: '/api/v1/class/room/list', method: 'post', data})
    }

    getClassStudents(class_id) {
        let data = {class_id}
        return request({url: '/api/v1/class/room/student/list', method: 'post', data})
    }
}
